/*
 *    Copyright 2022 jacky4631 shen ji email:121659050@qq.com
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package com.dataoke.shoppingguide.app773026.activity.home.fragment.me;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.dataoke.shoppingguide.app773026.BuildConfig;
import com.dataoke.shoppingguide.app773026.R;
import com.dataoke.shoppingguide.app773026.util.UIHelper;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
 *
 * @author: shen ji
 * @date: 2022/3/15
 * @email: 121659050@qq.com
 * @wechat: jacky4631
 */
public class AboutFragment extends Fragment implements
        android.view.View.OnClickListener {

    @BindView(R.id.tv_version_name)
    TextView mTvVersionName;

    @Override
    public View onCreateView(LayoutInflater inflater,
                             @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_about, container, false);
        ButterKnife.bind(this, view);
        initView(view);
        initData();
        return view;
    }

    public void initView(View view) {
        view.findViewById(R.id.tv_mwsite).setOnClickListener(this);
    }

    public void initData() {
        mTvVersionName.setText("V" + BuildConfig.VERSION_NAME);
    }

    @Override
    @OnClick(R.id.img_portrait)
    public void onClick(View v) {
        final int id = v.getId();
        switch (id) {
            case R.id.tv_mwsite:
                UIHelper.openInternalBrowser(getActivity(), "https://jkj.mailvor.com/?cid=sQwOpnhd");
                break;
            default:
                break;
        }
    }
}
